home *** CD-ROM | disk | FTP | other *** search
- Path: f411.n201!not-for-mail
- Newsgroups: comp.sys.cbm
- X-Comment-To: xxxxx@xxxxx.com
- From: Pontus Berg <Pontus.Berg@p71.anet.canit.se>
- Date: Wed, 24 Jan 96 01:29:41 +0100
- Subject: How did they do that?
- Message-ID: <822468144@p71.f411.n201.z2.ftn>
- References: <1298829101@xxxxx.com>
- Organization: BoArDgasm, Farsta, Sweden
- X-FTN-AREA: CANIT_COMP_SYS_CBM
- X-FTN-MSGID: 2:201/411.71 3105de30
- X-FTN-REPLY: xxxxx.com 4d6a8f2d
- X-FTN-CHRS: IBMPC 2
- X-FTN-Tearline: Spot 1.3a #676
- X-FTN-Origin: BoArDgasm, Farsta, Sweden (2:201/411.71)
- X-FTN-SEEN-BY: 201/411
- X-FTN-PATH: 201/411
- X-FTN-PATH: 201/411
-
- In a message of 22 Jan 96 xxxxx@xxxxx.com wrote to All:
-
- xxc> It is possible to show multiples of 8 sprites at once by splitting the
- xxc> screen up by raster interrupts. This is also how they put a text
- xxc> screen at the bottom of a graphics screen in some adventure games. I
- xxc> don't know the specifics, (tho I have the ML routines somewhere if u
- xxc> want them) but I suspect this is how they did it. I have seen as many
- xxc> as 64 sprites onscreen at once, but it is very flickery.
-
- I could EASILY do 8*as many as you can fit in Y-direction as long as I don't
- have to move them in Y-direction and this of course without flickering!
-
- Sprites are handy in lots of aspects (though some of the features are
- disadvantages in other aspects). You could f.ex. place the sprites and then give
- them a new Y value and they would still be fully plotted on the original
- position if as much as the first row of them has been plotted.
-
- Say f.ex. you wanted to plot lots of sprites and you started in position $20;
- You placed the sprites on rasterline $20(32). On the following line ($21) you
- could move the Y position of the sprites to row to $35 (32+21). You could do it
- on row $20 as well if you just made sure you have begun the plot of the sprite
- first! Then you get two set of sprites fitting top to bottom with NO flicker.
- Make sure you replace them at row $20 afterwars. Now you can just fill in the
- rest yourself by placing the next bunch on row $4a (32+21+21), $5f and so on
- till you filled the screen!
-
- One thing; If you are to do the easy way out by polling $D012 between, just
- make sure you handle the "bad lines" correctly with a check that would catch up
- even if you fail to deliver a compare on the exact line. This is also a problem
- when $d012 warps. (Don't know what happens to my routine round raster $100 i.e
- $D011 MSB set and $D012 = $00)
-
- I included an approach, written first time as it stands here in the mail so I
- will probably not work... ;-) You'd have to do a bit of setup of all values for
- the sprites (but the Y values as they are set in the loop anyway!). It of course
- asumed that the sprites are not Y expanded. I get the calculation to that you'd
- bee able to fit some 15 * 8 sprites (120!) without flickering here. You'd have
- to open the uper and lower border. You'd need to add border opening in the loop
- (which I won't do without testing it) to get the size to show them! (No point in
- having lots of sprites UNDER the border, now is there? ;-)
-
- The routine looks like garbage, but it will probably do it's job... It steals
- all the rastertime and uses 98% for polling $d012 but I'l leave to you to
- improve it!
-
-
- poll lda $d011 ;Wait untill the top of the screen!
- bmi poll
-
- start ldx #$00
- loop lda table,x
- sta $d001 ;The sprites X-positions!
- sta $d003
- sta $d005
- sta $d007
- sta $d009
- sta $d00b
- sta $d00d
- sta $d00f
- tay ;Use table value to compare with
- iny ;but tablevalue+1 - see the text above! loop2 cpy
- $D012
- bne loop2 ;could be BPL, BCC or something I never get right ;-)
- ;to make CERTAIN it doesn't fall trhough on
- ;a "BAD-line"
- inx
- cpx #$(number of spriterows, also number of values in table)
- bne start ; could be poll!
-
- table .byte $20,$35,$4a,$5f ; and on you go
-
-
-
- /Pontus Berg, Bacchus@FairLight.COM
-
- ... The C64 is my only religion!
- It's for real and can be proven and it's for sure devine!
- (Pontus Berg)
-